# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=csrftester
pkgver=1.0
pkgrel=4
pkgdesc='The OWASP CSRFTester Project attempts to give developers the ability to test their applications for CSRF flaws.'
url='http://www.owasp.org/index.php/Category:OWASP_CSRFTester_Project'
groups=('blackarch' 'blackarch-webapp')
license=('LGPL')
depends=('java-environment')
arch=('any')
source=("http://www.owasp.org/images/0/08/CSRFTester-$pkgver.zip")
sha512sums=('9166a74980724dd6daadd747f91464a82b9a7ec9e071237270b8c27f8c6f62d99dd269877adaca6979808b55cd0041fb844c4a6689ef7cbb5a986fae25eb698e')

package() {
  cd "CSRFTester-$pkgver"

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  cp -a * "$pkgdir/usr/share/$pkgname/"

  rm "$pkgdir/usr/share/$pkgname/run.bat"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec java -classpath ".:lib/concurrent.jar:OWASP-CSRFTester-1.0.jar" org.owasp.csrftester.CSRFTester
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

